package fight.view.armytype 
{
	import fight.FightC;
	import flash.display.Bitmap;
	import org.airmvc.Dispatcher;

	/**
	 * 骑士
	 * @author WLDragon 2014-05-06
	 */
	public class Sowar extends BaseArmy 
	{
		
		public function Sowar(isAttack:Boolean,hp:int,resName:String,dir:int, attackEffect:Bitmap, callBack:Function) 
		{
			super(isAttack,hp,resName,dir,attackEffect,callBack);
			
		}
		
		override protected function bruise(attacker:BaseArmy):void 
		{
			var baseHurt:int = getFactorB(attacker.hp) * factorA * 0.0075;
			hp -= baseHurt;
			
			if (hp <= 0)
			{
				var tx:int = this.x / 32;
				var ty:int = this.y / 32;
				mapData[ty][tx] = null;
				state = 5;
				
				baseHurt = baseHurt + hp;
			}
			
			Dispatcher.send(FightC.UPDATE_INFO_PANEL, this, isAttack, "sowarNum", baseHurt);
			
			if (hp <= 0)
				parent.removeChild(this);
		}
		
		/**是否为第二次机会*/
		public var isSecondTimes:Boolean;
	}

}